﻿@{
	Layout = "~/Views/Shared/_Layout.cshtml";
}

@model IEnumerable<dPet.Application.DataObjects.ProductSubCategoryDto>

<div class="page-header">
	<h3>商品小类管理 [ 大类: @ViewBag.CategoryName ]</h3>
</div>

<div class="panel panel-default">
	<div class="panel-heading">
		<a href="@Url.Action("CategoryList", "Product")" class="btn btn-default btn-sm"><span class="glyphicon glyphicon-chevron-left"></span> 返 回</a>
		<a href="@Url.Action("SubCategory", "Product", new { categoryId = ViewBag.CategoryId })" class="btn btn-info btn-sm" target="_self" title="添加小类"><span class="glyphicon glyphicon-plus-sign"></span> 添加小类</a>
	</div>
	<table class="table table-striped text-center">
		<thead>
			<tr>
				<th class="text-center">小类名称</th>
				<th class="text-center">操作</th>
			</tr>
		</thead>
		<tbody>
			@foreach (var subCategory in Model)
			{
				<tr>
					<td>@subCategory.Name</td>
					<td>
						<a href="@Url.Action("SubCategory", "Product", new { id = subCategory.Id, categoryId = ViewBag.CategoryId })">编辑</a>
					</td>
				</tr>
			}
		</tbody>
	</table>
</div>

@section scripts {
	<script type="text/javascript">
		$(document).ready(function () {
			set_left_nav('#ln_ProductCategoryList');
		});
	</script>
}